package com.sunjob.mroresumeproject.service;

import com.sunjob.common.domain.mroresume.BusAction;
import com.sunjob.common.domain.mroresume.CKParts;
import com.sunjob.common.util.MROUtils;
import com.sunjob.mroresumeproject.dao.BusActionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class BusActionServiceImpl implements BusActionService {

    @Autowired
    BusActionMapper busActionMapper;

    @Override
    public List<BusAction> queryBusAction2(String busid) {
        return busActionMapper.queryBusAction2(busid);
    }

    @Override
    public int querycount() {
        return busActionMapper.querycount();
    }

    @Override
    public List<BusAction> queryBusAction(int pages, int size) {
        return busActionMapper.queryBusAction(pages,size);
    }

    @Override
    public void insertBusAction(BusAction busAction) {
       busAction.setBusid(MROUtils.nextId());
       busAction.setIndate(LocalDateTime.now());
       busAction.setStatus(1);
       busActionMapper.insertBusAction(busAction);
    }


    @Override
    public List<BusAction> queryBusActionone(Long busid) {
        return busActionMapper.queryBusActionone(busid);
    }

    @Override
    public void deleteBusAction(String busid) {
    busActionMapper.deleteBusAction(busid);
    }

    @Override
    public void updateBusAction(BusAction busAction) {
     busActionMapper.updateBusAction(busAction);
    }

    @Override
    public void deleteBusActionone(String s) {
        busActionMapper.deleteBusActionone(s);
    }
}
